package com.baizhi.service.impl;

import com.baizhi.dao.questionDao;
import com.baizhi.Question;
import com.baizhi.service.questionService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import java.util.List;

public class questionServiceImpl implements questionService {
    private questionDao qd;
    @Override
    public List<Question> selectAll(int c) {
        List<Question> questions=null;
        if (c==0){
            questions = qd.selectList(null);
        }else {
            QueryWrapper<Question> wrapper = new  QueryWrapper<Question>();
            wrapper.eq("subject", c);
            questions = qd.selectList(wrapper);
        }
        return questions;
    }

    public questionDao getQd() {
        return qd;
    }

    public void setQd(questionDao qd) {
        this.qd = qd;
    }
}
